
from scripts import *;

gManager = 0;

class Manager:
	def __init__(self):
		global gManager;
		gManager = self;
		
		self.allOrders = {
			"stop": StopOrder()
		};
		self.defaultOrders = [
			self.LookupOrder('stop')
		];
		
	def LookupOrder(self, sOrder):
		return self.allOrders[sOrder];
	
	def GetInst():
		return gManager;
	GetInst = StaticM(GetInst);
	
	
class Order:
	def __init__(self):
		self.button = None;
		
class StopOrder(Order):
	def __init__(self):
		Order.__init__(self);
		
		self.caption = "Stop";
		self.description = "Stops the unit's current actions.";
		
	def Invoke(unit):
		unit.StopOrder();
	

# Orders the unit to build the specified unit - this starts
# positioning of the structure if the specified unit is a 
# structure
class BuildOrder(Order):
	def __init__(self, unit):
		Order.__init__(self);
		
		self.caption = "Build " + unit.getUnitName();
		self.description = unit.getUnitDescription();
		self.buildUnit = unit;
	
	def Invoke(unit):
		unit.StopOrder();